/*
 * This file is part of CompetitionGenerator.
 * CompetitionGenerator is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * CompetitionGenerator is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * 
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with CompetitionGenerator. If not, see <http://www.gnu.org/licenses/>.
 */
package competitiongenerator.testclasses;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class FocusTest extends JFrame implements KeyListener {

    JTextField jtf1, jtf2, jtf3;
    JPanel p;

    public FocusTest() {
        jtf1 = new JTextField(10);
        jtf2 = new JTextField(10);
        jtf3 = new JTextField(10);

        jtf1.addKeyListener(this);

        p = new JPanel();
        p.add(jtf1);
        p.add(jtf2);
        p.add(jtf3);

        getContentPane().add(p);
    }

    public static void main(String dd[]) {
        FocusTest ft = new FocusTest();
        ft.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        ft.setSize(200, 200);
        ft.setVisible(true);
    }

    @Override
    public void keyPressed(KeyEvent ke) {
        if (ke.getKeyCode() == KeyEvent.VK_ENTER) {
            System.out.println("ll");
            jtf3.requestFocus();
        }
    }

    @Override
    public void keyReleased(KeyEvent e) {}

    @Override
    public void keyTyped(KeyEvent e) {}

    
}